﻿@{
    ViewBag.Title = "FormData";
    Layout = "~/Views/Share/_BaseLayout.cshtml";
}
@section header{
      <script type="text/javascript">
          function add() {
              var data = {
                  UName: $("#txtUserName").val()
              };
              $.ajax({
                  url: 'AjaxPost',
                  data: data,
                  type: 'post',
                  dataType: 'json',
                  success: function (rep) { },
                  error: function (err) { }
              });
          }
      </script>
    }
<h2>FormData</h2>

<p>用户名:<input type="text" id="txtUserName"/></p>
<p>
    <input type="button" value="Add" onclick="add();" />
</p>
